package com.fw.service.servlet;

import java.io.IOException;
import java.util.Properties;

import javax.servlet.GenericServlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import org.apache.velocity.app.Velocity;

/**
 * Servlet implementation class StartupServlet
 */
public class StartupServlet extends GenericServlet {
    static final long serialVersionUID = (long) 1.00;

    public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
    }

    public void init(ServletConfig config) throws ServletException {
	try {
	    /*
	     * INITIAL VELOCITY
	     */
	    Properties props = new Properties();
	    props.put("resource.loader", "file");
	    props.put("file.resource.loader.class", "org.apache.velocity.runtime.resource.loader.FileResourceLoader");
	    props.put("file.resource.loader.path", ""); // !!!
	    props.put("file.resource.loader.cache", "true");
	    
	    Velocity.init(props);
	} catch (Exception e) {
	    e.printStackTrace();
	}
    }

}
